package com.adou.p2p.domain.entiry;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Entity
@Table(name="product")
@Getter
@Setter
@NoArgsConstructor
public class Product {
	@Id
	@Column(name = "id", unique = true, nullable = false, updatable = false)
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	@Basic
	@Column(name = "pro_num")
	private String proNum;
	
	@Basic
	@Column(name = "pro_name")
	private String proName;
	
	@Basic
	@Column(name = "pro_limit")
	private Long proLimit;
	
	@Basic
	@Column(name = "annualized")
	private Double annualized;
	
//	@Basic
//	 @Column(name = "releaseDate", insertable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
//	private Date releaseDate;
	
	@Builder
	public Product(Long id, String proNum, String proName, Long proLimit, Double annualized/*, Date releaseDate*/){
		this.id = id;
		this.proNum = proNum;
		this.proName = proName;
		this.proLimit = proLimit;
		this.annualized = annualized;
//		this.releaseDate = releaseDate;
	}
}
